Hello Posie,
ESA is based on your NI contributions, regardless of whether you have a work pension or savings, as you are still under 60 and below the age when you can apply for a state pension? I was ill health retired a couple of months ago with a pension, and still get ESA. I also got it when I was officially still employed. I double checked with the DWP and was told that I could continue on ESA.
Hope this helps,
love and well wishes,
Barbara
XXXXXX